home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / cstr22.zip / CSTR20.H_ / CSTR20.H
C/C++ Source or Header  |  1994-12-11  |  20KB  |  395 lines

  1. // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2. //
  3. //        CSTR20.H
  4. //        String Studio 2.02 - Header file for CSTR20A.CPP, CSTR20B.CPP ( or CSTR20R.LIB or CSTR20W.LIB )
  5. //        08.dec.1994
  6. //        «HEXANET, Written by Denis CHEVRON, 
  7. //        COPYRIGHT HEXANET 1993, 1994, ALL RIGHTS RESERVED
  8. //        You can distribute this file as long as you distribute
  9. //        the full CSTR package ( not the CSTR20A.CPP nor CSTR20B.CPP files! )
  10. // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  11. //        Current implementation is for MFC for DOS or WINDOWS (16bits).
  12. //        CSTR20W.LIB was compiled with Visual C++ 1.5 under the Windows static large model
  13. //        You must include "stdafx.h" or <afx.h> before you include this file. 
  14. //        CSTR20R.LIB was compiled with Visual C++ 1.5 under the DOS real mode large model.
  15. //        To rebuild this library you will need LAFXCR.LIB and maybe you need to build it from
  16. //        the MFC source code...
  17. // 
  18. // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  19. //    
  20. //        If you are a registered user, you will define _REGISTERED in your STDAFX.H precompiled header before 
  21. //        you compile this file to avoid the nag screens.
  22. //        If you use this library with the source code with QuickWin, undefine _WINDOWS and define _DOS.
  23. // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  24. //
  25. //            Attn. to 1.x users...
  26. //            Some old functions were re-written ( like the () operator, From, To, Extract ) so, have a look at 
  27. //            this file before you compile with this new library.
  28. // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  29. //
  30. //            GLOBAL FUNCTIONS ( Afx... )
  31. //          Infos: AfxGetFreeResRate, AfxGetFreeResValue
  32. //            User' s config infos: AfxGetPrecision, AfxGetDecimalPoint, AfxGetThousandsSeparator,
  33. //                                            AfxGetShortDateFormat, AfxGetShortDateFormat, AfxGetLongDateFormat
  34. //            CTL3D wrappers: AfxCtl3dLoad, AfxCtl3dUnload, AfxCtl3dNewColors
  35. //            Windows coordinates: AfxWriteWindowPos, AfxGetWindowPos
  36. //            Math: AfxRoundToInt, AfxRound
  37. //            Misc.: AfxFindWordInFile, AfxCheckFileName, AfxIsDateValid
  38. //
  39. //            CONSTRUCTORS
  40. //            Same as CString, plus a constructor which uses a string resource ID.
  41. //
  42. //            INPUT
  43. //            From ( long / ulong / int / UINT / double ( precision ) / CTime  )
  44. //            FromCurrentTime( mask )
  45. //            FromFileTime                                                                                                  
  46. //            FromRes
  47. //
  48. //            OUTPUT
  49. //            ToInt, ToUINT, ToLong, ToULong, ToFloat, ToDouble, ToTime
  50. //
  51. //            OPERATIONS
  52. //            Trim : Trim, TrimBegin, TrimEnd
  53. //            Find: Count, FindWord, FindWordInMultilineBuffer
  54. //            Extract/Insert: Extract, ExtractToBegin, ExtractToEnd, Insert, Delete, Replace
  55. //            Operators: () (replace []) , GetBuffer                 
  56. //
  57. //            OTHERS
  58. //            Blank, Replicate, AddLF, FirstUpper
  59. //
  60. //            NUMBERS
  61. //            IsDigit, IsInRange, Round
  62. //
  63. //            INTERFACE
  64. //            ToCtl, FromCtl, MB, CheckSize, CheckDirSize
  65. //
  66. //            FILES
  67. //            ToFile, FromFile, ToIni, FromIni
  68. //
  69. //            FILE NAMES (2.0)
  70. //            Infos: IsFileName, IsPathName, IsFullFileName
  71. //            Extraction: GetPathValue, GetFileNameValue
  72. //            Test: CheckFullFileName, CheckFileExtension, DoesFileExist, DoesDirExist
  73. //            Misc: GetTempFileName
  74. //
  75. //            DIRECTORIES (2.0)
  76. //            ChDir, MkDir, GetAppDir, GetWinDir, GetWinSysDir, GetThisDir
  77. //
  78. //            CHARACTERS (2.0)
  79. //            Infos: IsCharUpper, IsCharLower, IsCharAlpha, IsCharAlphaNum, IsNumeric, IsSpace
  80. //            Modif: MakeCharUpper, MakeCharLower
  81. //
  82. //            GDI (2.0)
  83. //            GetTextWidth, GetTextHeight, TabbedTextOut
  84. //
  85. //            WINDOWS SPECIFIC (2.0)
  86. //            GetWindowTitle, GetClassName, GetWinfileAssociation
  87. //
  88. //            CTim class (2.0)
  89. //          Constructors: same as CTime
  90. //            Build: Build, FromFile
  91. //            Modification: SetDay, SetMonth, SetYear, SetHour, SetMin, SetHour, IncDay, IncSec, IncMin, IncHour
  92. //            Infos: IsLeapYear, IsLastDay
  93. //            
  94. // 
  95. // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  96.  
  97. #ifndef __cplusplus
  98. #error require C++ compilation (use a .cpp suffix)
  99. #endif
  100.  
  101. #ifndef _CSTR
  102.     #define _CSTR
  103. #endif
  104. #ifndef _CSTR20
  105.     #define _CSTR20
  106. #endif
  107.  
  108. #ifdef _DOS
  109.     #define _REGISTERED            // No nag screen with DOS...               
  110.     #define TA_LEFT            0x0000
  111.     #define TA_RIGHT       0x0002
  112.     #define TA_CENTER     0x0006
  113.     #pragma message("String Studio 2.0: Using the DOS version...")
  114. #else
  115.     #ifdef _REGISTERED
  116.         #pragma message("String Studio 2.0 (REGISTERED): Using the Windows version...")
  117.     #else
  118.         #pragma message("String Studio 2.0 (UNREGISTERED): Using the Windows version...")
  119.     #endif                   
  120. #endif
  121.  
  122.  
  123. // ------------------------------------ NEW GLOBAL FUNCTIONS (2.0) -----------------------------------------------
  124. #ifdef _WINDOWS    
  125.     #define FREERES_GLOBAL                    0              // System
  126.     #define FREERES_USER                       1
  127.     #define FREERES_GDI                          2
  128.     #define FREERES_MEM                        3
  129.     #define FREERES_DISK                       4               // in Kb.
  130.  
  131.     extern UINT AfxGetFreeResRate( int iResCode );
  132.     extern unsigned long AfxGetFreeResValue( int iResCode );
  133.     extern int AfxGetPrecision();
  134.     
  135.     class CStr;
  136.     extern CStr AfxGetDecimalPoint();
  137.     extern CStr AfxGetThousandsSeparator();
  138.     extern CString AfxGetShortDateFormat();
  139.     extern CString AfxGetLongDateFormat();
  140.     
  141.     // Ctl3D ( release 2.0 only ) wrappers for the TRUE MFC applications
  142.     #define        AFXCTL3D_OK                                0          // Ok to use CTL3D
  143.     #define        AFXCTL3D_NOTFOUND                1            // The user doesn' t get this DLL
  144.     #define        AFXCTL3D_BADDLL                     2           // Error
  145.     #define     AFXCTL3D_ERROR                       3            // Error
  146.     
  147.     #ifndef CTL3D_ALL
  148.         #define CTL3D_ALL                0xffff
  149.     #endif
  150.  
  151.     extern "C" int AfxCtl3dLoad(  );
  152.     extern "C" BOOL AfxCtl3dUnload(  );
  153.     extern "C" BOOL AfxCtl3dNewColors(  );
  154.     
  155.     // Window position functions
  156.     extern BOOL AfxWriteWindowPos( HWND hWnd , BOOL bUseParent = FALSE, LPCSTR szWindowName = "Main", LPCSTR szIni = NULL );
  157.     extern RECT  AfxGetWindowPos( HWND hWnd = NULL, LPCSTR szWindowName = "Main", LPCSTR szIni = NULL, BOOL bMove = TRUE, BOOL bSize = FALSE);                
  158.     extern BOOL AfxCenterWindow( CWnd* pWnd, BOOL bAbsolute = TRUE );
  159.  
  160.     // Maybe the following functions will simplify your MFC dialogs programming...
  161.     extern BOOL AfxEnableDlgItem( CWnd* pWnd, UINT id = 1, BOOL bEnabled = TRUE );
  162.     extern BOOL AfxEnableOK( CWnd* pWnd, BOOL bEnabled = TRUE);
  163.     extern BOOL AfxEnableCANCEL( CWnd* pWnd, BOOL bEnabled = TRUE);
  164.     extern void AfxSetFocus( CWnd* pWnd, UINT id = 1 );
  165.     extern void AfxSetDefButton( CWnd* pWnd, UINT id = 1);
  166.     extern void AfxActivateEdit( CWnd* pWnd, UINT id );
  167.             
  168. #endif // windows
  169.  
  170.     #define AfxRoundToInt(x) floor((x)+0.5)
  171.     extern double AfxRound( double x, int precision = 2);
  172.     extern BOOL AfxFindWordInFile( LPCSTR szFile, LPCSTR szWord, unsigned long iFromLine = 0L, int iFromCursor = 0, 
  173.                                       unsigned long* rLineValue = NULL, int* rCursorValue =NULL, BOOL bExact = TRUE, BOOL bMatchCase = FALSE );
  174.     extern BOOL AfxCheckFileName( CString& sValue, BOOL bNoWildCards = TRUE);            
  175.     extern BOOL AfxIsDateValid( int iYear, int iMonth, int iDay );
  176.     
  177. // ----------------------------------------------------------------------------------------------------------------------------------
  178.  
  179. typedef signed long SLong;
  180.             class CStr : public CString
  181.                 { 
  182.                 public:
  183.                 #ifdef _REGISTERED
  184.                     CStr( void ):  CString( ) {};                                                        
  185.                     CStr( const CString& stringSrc): CString( stringSrc ) {};
  186.                     CStr( char ch, int nRepeat = 1): CString(ch, nRepeat ) {};
  187.                     CStr( const char* psz): CString( psz ) {};
  188.                     CStr( const char* pch, int nLength): CString( pch, nLength ) {};
  189.                     #ifdef _WINDOWS                                            
  190.                         CStr( UINT iStringID, HINSTANCE hInstance = NULL ): CString() 
  191.                             { 
  192.                             if ( hInstance == NULL ) this->LoadString ( (UINT)iStringID);
  193.                                 else
  194.                                 {
  195.                                 ::LoadString( hInstance, (UINT)iStringID, this->GetBuffer(256), 256 );
  196.                                 this->ReleaseBuffer();
  197.                                 } 
  198.                             }; 
  199.                     #endif                                    
  200.                 #else
  201.                     CStr( void ); 
  202.                     CStr( const CString& stringSrc); 
  203.                     CStr( char ch, int nRepeat = 1);
  204.                     CStr( const char* psz); 
  205.                     CStr( const char* pch, int nLength); 
  206.                     #ifdef _WINDOWS                                            
  207.                         CStr( UINT iStringID, HINSTANCE hInstance = NULL );
  208.                     #endif
  209.                 #endif
  210.                     CString Trim( void );
  211.                     CString TrimBegin( void );
  212.                     CString TrimEnd( void );
  213.                     unsigned int Count( LPCSTR szSubString ) const;
  214.                     unsigned int Count( char szSubString ) const;
  215.                     CString From( long data, int base = 10, LPCSTR szSeparator = ",");
  216.                     CString From( unsigned long data, int base = 10, LPCSTR szSeparator = ",");
  217.                     CString From( int data, int base = 10, LPCSTR szSeparator = ",");
  218.                     CString From( unsigned int data, int base = 10, LPCSTR szSeparator = ",");    // 2.0
  219.                     CString From( double data, int precision = 2, LPCSTR szSeparator = ",", LPCSTR szDecimalPoint = "." );
  220.                     
  221.                     
  222.                 // --------------------------------- NEW FUNCTIONS (2.0) SEE CSTR20B.CPP -------------------------------
  223.                 // Files and Dirs
  224.                 BOOL IsFileName( BOOL bAllowWildCards = FALSE ) const;
  225.                 BOOL IsPathName(  ) const;
  226.                 BOOL IsFullFileName( BOOL bNoWildCards = TRUE ) const;
  227.                 CStr     GetPathValue( );
  228.                 CStr     GetFileNameValue( );
  229.                 CStr     CheckFullFileName( BOOL bNoWildCards = TRUE, BOOL bAddSlash  =FALSE);
  230.                 CStr     CheckFileExtension( LPCSTR szExtension, BOOL bForceExtension = FALSE);
  231.                 BOOL  ChDir( BOOL bIncludesFName = FALSE, BOOL bCreateDir = FALSE) const;
  232.                 BOOL  MkDir( BOOL bIncFile = FALSE) const;
  233.                 BOOL DoesFileExist( ) const;
  234.                 BOOL DoesDirExist( BOOL bIncFile = FALSE) const;
  235.             #ifdef _WINDOWS
  236.                 CStr GetAppDir( LPCSTR szAppName = NULL );        
  237.                 CStr GetWinDir( );                                                      
  238.                 CStr GetWinSysDir( );                                                
  239.             #endif
  240.                 CStr GetThisDir( );
  241.                 CStr GetTempFileName( );
  242.                 CStr GetTempDir();
  243.  
  244.                 // Character informations
  245.                 BOOL IsCharUpper( int iIndex = 0) const;
  246.                 BOOL IsCharLower( int iIndex  =0) const;
  247.                 BOOL IsCharAlpha( int iIndex  =0) const;
  248.                 BOOL IsCharAlphaNum( int iIndex =0) const;
  249.                 BOOL IsCharNumeric( int iIndex =0) const;
  250.                 BOOL IsSpace( int iIndex =0) const;
  251.                 // Numeric datas format
  252.                 CStr NumFormat( double dValue, LPCSTR szFormat = "###,###,###,###.00;-###,###,###,###.00; ", LPCSTR szDecimalPoint = ".", LPCSTR szThousandSeparator ="," );
  253.                 CStr NumUnformat( LPCSTR szDecimalPoint = "." );
  254.                 // Alignment function
  255.                 CStr Align( int aMode, int iSize );
  256.                 // Character modificattions
  257.                 CStr MakeCharUpper( int iIndex =0);
  258.                 CStr MakeCharLower( int iIndex =0);
  259.                 // Extract like functions
  260.                 CStr ExtractToEnd( int iFrom, char szSeparator );
  261.                 CStr ExtractToEnd( int iFrom, LPCSTR szSeparator = ";" );
  262.                 CStr ExtractToBegin( int iFrom, char szSeparator );
  263.                 CStr ExtractToBegin( int iFrom, LPCSTR szSeparator = ";" );
  264.                 // Find a word
  265.                 int FindWord( LPCSTR szWord, int iFrom = 0, BOOL bExact = TRUE, BOOL bMatchCase =FALSE) const;              
  266.                 BOOL FindWordInMultilineBuffer( LPCSTR szWord, unsigned long iFromLine = 0L, int iFromCursor = 0, 
  267.                                                           unsigned long* rLineValue = NULL, int* rCursorValue = NULL, BOOL bExact = TRUE, BOOL bMatchCase =FALSE  ) const;
  268.             
  269.                 #ifdef _WINDOWS 
  270.                     CStr FromRes( UINT iStringID, HINSTANCE hInstance = NULL, LPCSTR szItem1 = NULL, LPCSTR szItem2 = NULL,  LPCSTR szItem3 = NULL, LPCSTR szItem4 = NULL, 
  271.                                             LPCSTR szItem5 = NULL, LPCSTR szItem6 = NULL, LPCSTR szItem7 = NULL, LPCSTR szItem8 = NULL, LPCSTR szItem9 = NULL );
  272.                     int GetTextWidth( HDC hDC, int iTabCount = 0, int far* pTabList = NULL ) const;    
  273.                     int GetTextWidth( CDC* pDC , int iTabCount = 0, int far* pTabList = NULL ) const;
  274.                     int GetTextWidth( CWnd* pWnd , int iTabCount = 0, int far* pTabList = NULL ) const;
  275.                     int GetTextHeight( HDC hDC , int iTabCount = 0, int far* pTabList = NULL ) const;
  276.                     int GetTextHeight( CDC* pDC , int iTabCount = 0, int far* pTabList = NULL ) const;
  277.                     int GetTextHeight( CWnd* pWnd , int iTabCount = 0, int far* pTabList = NULL ) const;
  278.                     CStr GetWindowTitle( CWnd* pWnd, BOOL bIncDocName = FALSE );        
  279.                     CStr GetWindowTitle( HWND hWnd, BOOL bIncDocName = FALSE );        
  280.                     CSize TabbedTextOut( CDC* pDC, int X, int Y, int iTabCount = 0, int far* TabList = NULL ) const; 
  281.                     CSize TabbedTextOut( CWnd* pWnd, int X, int Y, int iTabCount = 0, int far* TabList = NULL ) const; 
  282.                     int GetClassName( CWnd* pWnd );                                
  283.                     int GetClassName( HWND hWnd );                                
  284.                     CStr GetWinfileAssociation( LPCSTR szExtension );    
  285.                     int GetDlgItemText( CWnd* pWnd, UINT iControl );
  286.             
  287.                 #endif
  288.                 
  289.                 
  290.                 // --------------------------------- OTHER METHODS -------------------------------
  291.                 #if !defined(_AFXDLL) && !defined(_USRDLL)
  292.                     CString From( CTime TimeValue, LPCSTR szFilter = "%m/%d/%y" );    // put %d/%m/%y if you' re french...
  293.                     CString FromCurrentTime( LPCSTR szFilter = "%m/%d/%y" ); // put %d/%m/%y if you' re french...
  294.                     CString FromFileTime( LPCSTR szFile, LPCSTR szFilter = "%m/%d/%y" );  // put %d/%m/%y if you' re french...
  295.                 #else
  296.                     #pragma message("String Studio 2.0: Some CStr CTime functions not available with _AFXDLL or _USRDLL!")
  297.                 #endif    
  298.                     signed int ToInt( LPCSTR szSeparator = ",") const;
  299.                     UINT ToUINT( LPCSTR szSeparator = ",") const;
  300.                     signed long ToLong( LPCSTR szSeparator = ",") const;
  301.                     unsigned long ToULong( LPCSTR szSeparator = ",") const;
  302.                     float ToFloat( LPCSTR szSeparator = ",", LPCSTR szDecimalPoint = "." ) const;
  303.                     double ToDouble( LPCSTR szSeparator = ",", LPCSTR szDecimalPoint = "." ) const;
  304.                     //     WARNING: the <ToTime> function use M instead of m for the month, others parameters
  305.                     //    are the same than _strftime C runtime function, and ToTime supports: [ D, Y, y, S ]
  306.                     CTime ToTime( LPCSTR szFilter = "M/D/Y" ) const; // put y io. Y to use a date without century specification, put D/M/Y if you' re french...
  307.                     CStr Delete( unsigned PFirst = 0, unsigned Plength = 0 );
  308.                       CStr Replace( LPCSTR szOld, LPCSTR szNew = "" );
  309.                       CStr Replace( char szOld, char szNew  );
  310.                       CStr Insert( LPCSTR szSub, int Pos  = 0 );
  311.                     CStr Insert( char szSub, int Pos  = 0 );
  312.                     CStr Extract( int Pos = 1, LPCSTR szDelimit = "\t" ); 
  313.                     CStr Extract( int Pos, char szDelimit );
  314.                     char& operator() (int Index );    // new 2.0: Replace the [] operator
  315.                     virtual LPSTR CStr::GetBuffer( int size = 0);
  316.                     CStr Round( LPCSTR szDecimalPoint = ".");
  317.                     CStr FirstUpper( void );
  318.                       CStr AddLF( void );                   
  319.                       CStr Blank( void );
  320.                       CStr Replicate( char cMotif = ' ', int iLen = 1 );
  321.                       CStr CheckSize( int iLength = 255, BOOL bAddPoints = TRUE ); 
  322.                       CStr CheckDirSize( int iLength = 60, BOOL bShift = TRUE );
  323.                       BOOL IsDigit( LPCSTR szSeparator = ",", LPCSTR szDecimalPoint = "." ) const;
  324.                       BOOL IsInRange( double dMini = 0, double dMaxi  = 100 ) const;
  325.                     CStr FromIni( LPCSTR szSection, LPCSTR szKey, LPCSTR szFile = NULL, int iSize = 512 );
  326.                     void ToIni( LPCSTR szSection, LPCSTR szKey, LPCSTR szFile = NULL ) const;         
  327.                     CStr FromFile( LPCSTR szFile, BOOL bKeepString = FALSE, BOOL bAddPoints = TRUE );
  328.                     BOOL ToFile( LPCSTR szFile, BOOL bAppend = TRUE ) const;
  329.                 #ifdef _WINDOWS
  330.                     void ToCtl( CWnd* pWnd, int iCtl, BOOL bAltMode = FALSE ) const;
  331.                     CStr FromCtl( CWnd* pWnd, int iCtl );       
  332.                     int MB( CWnd* pWnd = NULL, LPCSTR szTitle = NULL, UINT mbType = MB_OK | MB_ICONINFORMATION ) const;
  333.                 #endif             
  334.                     
  335.                 protected:     // don' t call these functions!  --------------------------------------------------------------------------------
  336.                     LPSTR TrimTout( LPSTR str );            // TrimAll
  337.                     LPSTR TrimAuDebut( LPSTR str );        // TrimBegin
  338.                     LPSTR TrimALaFin( LPSTR str );         // TrimEnd
  339.                     void FromDouble( LPSTR pStr, double data, int precision, LPCSTR szDecimalPoint = "." );
  340.                     char GarbageChar;                                           
  341.                     CStr NumberFormat( LPCSTR szSeparator = ",", LPCSTR szDecimalPoint = "." );
  342.                     void NumFormatLPSTR( LPSTR szFormat, LPSTR szFResult, double dValue, LPCSTR szDecimalPoint = ".", LPCSTR szThousandSeparator = ",");
  343.                 };
  344.  
  345.  
  346.                 
  347.             // -----------------------------------------------------------------------------------------------------------------------------------------------------------
  348.             //    CTim, the CTime extension ( NEW 2.0 ), see CSTR
  349.             // -----------------------------------------------------------------------------------------------------------------------------------------------------------
  350.  
  351. #ifndef _CTIM
  352.     #define _CTIM
  353. #endif
  354. #ifndef _CTIM20
  355.     #define _CTIM20
  356. #endif
  357.                 
  358.             #define CTIME_OK                        0
  359.             #define CTIME_OVERFLOW          1
  360.             #define CTIME_NOTVALID              2
  361.             
  362.             class CTim : public CTime
  363.                 { 
  364.                 public:
  365.                     CTim( void ) : CTime(1980, 1, 1, 0, 0, 0) {};        // we can' t use the standard constructor...
  366.                     CTim( const CTime& timeSrc ) : CTime( timeSrc ) {};
  367.                     CTim( time_t time ) : CTime( time ) {};
  368.                     CTim( int nYear, int nMonth, int nDay, int nHour = 0, int nMin = 0, int nSec = 0 ): CTime( nYear, nMonth, nDay, nHour, nMin, nSec ) {};
  369.                     CTim( WORD wDosDate, WORD wDosTime ) : CTime( wDosDate, wDosTime ) {};
  370.                                 
  371.                     int Build( int iYear, int iMonth, int iDay, int iHour = 0, int iMin = 0, int iSec = 0 );            
  372.                     BOOL FromFile( LPCSTR szFile );
  373.                     
  374.                     BOOL SetDay( int iDay = 1 );        //All these methods change the current CTim object...
  375.                     BOOL SetDay( LPCSTR szDay );
  376.                     BOOL SetMonth( int iMonth = 1 );
  377.                     BOOL SetMonth( LPCSTR szMonth );
  378.                     BOOL SetYear( int iYear );
  379.                     BOOL SetYear( LPCSTR szYear );
  380.                     BOOL SetSec( int iSec = 0 );
  381.                     BOOL SetSec( LPCSTR szSec );
  382.                     BOOL SetMin( int iMin = 0 );
  383.                     BOOL SetMin( LPCSTR szMin );
  384.                     BOOL SetHour( int iHour = 23 );
  385.                     BOOL SetHour( LPCSTR szHour );
  386.                     
  387.                     BOOL IncDay( int iDay = 1 );
  388.                     BOOL IncSec( int iSec = 1 );
  389.                     BOOL IncMin( int iMin = 1 );
  390.                     BOOL IncHour( int iHour = 1 );
  391.                     
  392.                     BOOL IsLeapYear( ) const;
  393.                     BOOL IsLastDay() const; // last day of the month
  394.                   };           
  395.